<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<#include "/admin/include/head.htm">
<#include "/admin/include/upload.ftl">
<script type="text/javascript">
$(function(){
	var mainform = $("#mainform");  
	//表单底部按钮 
    LG.setFormDefaultBtn(f_cancel, function(){
		f_save(mainform, "advert_list");
	});
	
	$(".browserButton").browser({uploadType:'advert'});
});
</script>
<#if !advertDomain??>
	<#assign isAdd = true />
<#else>
	<#assign isEdit = true /> 
</#if>
</head>
<body style="padding:10px; ">
	<div id="tabcontainer" style="margin:0; padding:0">
		<form action="<#if isAdd??>save.jhtml<#else>update.jhtml</#if>" method="post" class="validate" id="mainform">
			<#if !isAdd??>
				<input type="hidden" name="id" value="${(advertDomain.id)!''}"/>
			</#if>
			<table class="table">
				<tr>
					<th>广告名称：</th>
					<td>
						<input type="text" name="name"  value="${(advertDomain.name)!''}"	
						class="formText {required: true, maxlength: 20}" />				
					</td>
				</tr>
				<tr>
					<th>广告位置：</th>
					<td>
						<@u.select headerKey="" headerValue="请选择..." listKey="id" listValue="title"
							headerButtom="false" list=allAdvertPosition value="${((advertDomain.advertPosition.id)!position.id)!''}"
							name="advertPosition.id" class="{required: true}"/>
					</td>										
				</tr>
				<tr>
					<th>是否开启：</th>	
					<td><@u.radio name= "isOpen" list={"true":"是", "false": "否"} 
							value="${(advertDomain.isOpen?string('true', 'false'))!'false'}"/>
					</td>									
				</tr>				
				<tr>
					<th>起始时间：</th>				
					<td>
						<input type="text" id="startTime" name="startTime" value="${(advertDomain.startTime?string('yyyy-MM-dd'))!''}"
						 	class="formText WdatePicker {dateFmt:'yyyy-MM-dd'}" />
					</td>
				</tr>
				<tr>
					<th>终止时间：</th>
					<td>
						<input type="text" id="endTime" name="endTime" value="${(advertDomain.endTime?string('yyyy-MM-dd'))!''}"
						 	class="formText WdatePicker {dateFmt:'yyyy-MM-dd'}" />
					</td>			
				</tr>
				<tr>
					<th>广告链接：</th>
					<td>
						<input type="text"  name="url" value="${(advertDomain.url)!''}" class="formText {required: true}"/>
					</td>					
				</tr>
				<tr>
					<th>路径：</th>
					<td>
						<input type="text" value="${(advertDomain.logo)!''}" name="logo" class="formText {required: true}">
						<input type="button" value="选择图片" class="button browserButton">
					</td>									
				</tr>
				<tr>
					<th>背景图片：</th>
					<td>
						<input type="text" value="${(advertDomain.background)!''}" name="background" class="formText">
						<input type="button" value="选择图片" class="button browserButton">
					</td>									
				</tr>
				<tr>
					<th>排序：</th>
					<td>
						<input type="input" value="${(advertDomain.priority)!'0'}" name="priority" class="formText">
					</td>									
				</tr>
				<tr>
					<th>单位名称：</th>
					<td>
					   <input type="text"  name="unitName" value="${(advertDomain.unitName)!''}" class="formText "/>
					</td>					
				</tr>
				<tr>
					<th>联系人：</th>
					<td>
						<input type="text"  name="linkMan" value="${(advertDomain.linkMan)!''}" class="formText "/>
					</td>					
				</tr>
				<tr>
					<th>联系方式：</th>
					<td>
						<input type="text"  name="cantact" value="${(advertDomain.cantact)!''}" class="formText {mobileOrTelephone:true}"/>
					</td>					
				</tr>
			</table>
		</form>
	</div>
</body>
</html>